-
Notifications
You must be signed in to change notification settings - Fork 8k
Fix Solaris tests and enable CI #20709
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
bbc1c07 to
9c9436d
Compare
|
cc @iluuu1994 at least for the CI's aspect. |
| --SKIPIF-- | ||
| <?php | ||
| if (!function_exists("pcntl_setcpuaffinity")) die("skip pcntl_setcpuaffinity is not available"); | ||
| if (PHP_OS_FAMILY === 'Solaris') die("skip CPU affinity not supported on Solaris"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is the test failing and in which manner ? because as far as I see it is supported by solaris.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It fails like this:
Running selected tests.
TEST 1/1 [ext/pcntl/tests/pcntl_cpuaffinity.phpt]
========DIFF========
001- bool(true)
002- array(0) {
003- }
004- array(0) {
005- }
006- bool(true)
007- pcntl_setcpuaffinity(): Argument #2 ($cpu_ids) must not be empty
008- pcntl_setcpuaffinity(): Argument #2 ($cpu_ids) cpu id invalid value (def)
009- pcntl_setcpuaffinity(): Argument #2 ($cpu_ids) cpu id must be between 0 and %d (%d)
010- pcntl_setcpuaffinity(): Argument #2 ($cpu_ids) cpu id must be between 0 and %d (-1024)
011- pcntl_getcpuaffinity(): Argument #1 ($process_id) invalid process (-1024)
012- pcntl_setcpuaffinity(): Argument #2 ($cpu_ids) value must be of type int|string, array given
001+ Warning: pcntl_setcpuaffinity(): pset_create: Cannot allocate memory in /root/php-src/ext/pcntl/tests/pcntl_cpuaffinity.php on line 3
002+ bool(false)
003+
004+ Warning: pcntl_getcpuaffinity(): pset_create: Cannot allocate memory in /root/php-src/ext/pcntl/tests/pcntl_cpuaffinity.php on line 4
005+
006+ Fatal error: Uncaught TypeError: array_diff(): Argument #2 must be of type array, false given in /root/php-src/ext/pcntl/tests/pcntl_cpuaffinity.php:5
007+ Stack trace:
008+ #0 /root/php-src/ext/pcntl/tests/pcntl_cpuaffinity.php(5): array_diff(Array, false)
009+ #1 {main}
010+ thrown in /root/php-src/ext/pcntl/tests/pcntl_cpuaffinity.php on line 5
========DONE========
FAIL pcntl_getcpuaffinity() and pcntl_setcpuaffinity() [ext/pcntl/tests/pcntl_cpuaffinity.phpt]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the test might need adaptation rather than disabling it, pset_create seems to set errno to ENOMEM here. We can devise about it later..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
btw do you run it under a VM ? curious also what psrset gives
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
btw do you run it under a VM ? curious also what
psrsetgives
Yes, it's VM. When I run test on real machine I get:
========DIFF========
--
pcntl_setcpuaffinity(): Argument #2 ($cpu_ids) cpu id invalid value (def)
pcntl_setcpuaffinity(): Argument #2 ($cpu_ids) cpu id must be between 0 and %d (%d)
pcntl_setcpuaffinity(): Argument #2 ($cpu_ids) cpu id must be between 0 and %d (-1024)
011- pcntl_getcpuaffinity(): Argument #1 ($process_id) invalid process (-1024)
pcntl_setcpuaffinity(): Argument #2 ($cpu_ids) value must be of type int|string, array given
========DONE========
FAIL pcntl_getcpuaffinity() and pcntl_setcpuaffinity() [ext/pcntl/tests/pcntl_cpuaffinity.phpt]
I don't see difference in psrset output between VM and real machine. Both give lines like:
processor set SYSpsrset_1 1: empty
..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok that should be largely enough, when I implemented this feature, it I just used a openindiana VM with only 8GB.
That might be swap space issue ; I guess you re really booting a 64 bits kernel.
That would be sad to disable this test just because of particular environment context.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, there is something wrong with VM. Another one doesn't have the problem.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure about this one. For now I left it disabled:
TEST 1/1 [ext/pcntl/tests/pcntl_getcpu.phpt]
========DIFF========
bool(true)
002- int(1)
002+ int(2)
========DONE========
FAIL pcntl_getcpu() [ext/pcntl/tests/pcntl_getcpu.phpt]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this one issue seems real at first glance, the test should not even launch on solaris/illumos. Is HAVE_SCHED_GETCPU commented in your main/php_config.h ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it is (/* #undef HAVE_SCHED_GETCPU */).
| # define MIN(x, y) ((x) > (y)? (y) : (x)) | ||
| #endif | ||
|
|
||
| #define SEG_ALLOC_SIZE_MAX 32*1024*1024 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it seems a slightly unrelated change to me (I do not say it is right or wrong tough).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On Solaris, OPcache uses the SysV SHM allocator (shared_alloc_shm.c), which hard-limits individual segments to 32 MB (SEG_ALLOC_SIZE_MAX). With JIT enabled, OPcache reserves a default 64 MB buffer (ZEND_JIT_DEFAULT_BUFFER_SIZE) from the last shared segment during zend_shared_alloc_startup(). This makes startup fail with “Insufficient shared memory!” because the last segment can never satisfy the reservation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure, but what I understood from the comment is opcache on solaris can't work without this change ? If that is the case, this change needs to be a PR on its own as a bug fix (from the lowest branch it needs to apply).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have created #20719 .
9c9436d to
924f86d
Compare
| die("skip Test is not valid for Windows"); | ||
| } | ||
| if (PHP_OS_FAMILY === 'Solaris') { | ||
| die("skip Solaris uses ' 8:08:08 AM' for %r (time format differs)"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as a follow-up PR, might be worth doing solaris only versions of tests related to time formats.
|
|
||
| #if defined(_POSIX_TZNAME_MAX) | ||
| # define MAX_ABBR_LEN _POSIX_TZNAME_MAX | ||
| /* Solaris exposes _POSIX_TZNAME_MAX = 3 unless _XPG6 is defined. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you could not know, that needs to be a PR on its own here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one is already in upstream:
derickr/timelib@4105b6f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The second one to this file is waiting here: derickr/timelib#169 .
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess it might be better to update timelib in its own PR.
trusting the call to handle invalid process id via errnos. see php#20709 (comment) for rationale.
92dfd8d to
e0f04d9
Compare
e0f04d9 to
106b74e
Compare
| if (!defined("AF_PACKET")) { | ||
| die('SKIP AF_PACKET not supported on this platform.'); | ||
| } | ||
| if (!defined("ETH_P_IP")) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh I m surprised solaris ever supports it the same way as linux.
| die("skip UTF-8 is not supported?"); | ||
| } | ||
|
|
||
| if (PHP_OS_FAMILY === 'Solaris') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
quick question, can solaris have iconv via a 3rd party package system (I guess opencsw is old now but maybe pkgsrc or similar).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we would still need to do some check in tests for such packages so there would need be some sort of skip anyway. It should not be a blocker for this though.
bukka
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, having Solaris in the CI would be great. It looks mostly good. Just needs some minor changes and guess we will also need to wait for #20719 .
| - name: FreeBSD | ||
| uses: ./.github/actions/freebsd | ||
| SOLARIS: | ||
| if: github.repository == 'psumbera/php-src' || github.event_name == 'pull_request' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| if: github.repository == 'psumbera/php-src' || github.event_name == 'pull_request' | |
| if: github.repository == 'php/php-src' || github.event_name == 'pull_request' |
| run_linux_ppc64: ${{ (matrix.branch.version[0] == 8 && matrix.branch.version[1] >= 4) || matrix.branch.version[0] >= 9 }} | ||
| run_macos_arm64: ${{ (matrix.branch.version[0] == 8 && matrix.branch.version[1] >= 4) || matrix.branch.version[0] >= 9 }} | ||
| run_freebsd_zts: ${{ (matrix.branch.version[0] == 8 && matrix.branch.version[1] >= 3) || matrix.branch.version[0] >= 9 }} | ||
| run_solaris_zts: ${{ (matrix.branch.version[0] == 8 && matrix.branch.version[1] >= 3) || matrix.branch.version[0] >= 9 }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As we won't be backporting the test changes this is effectively ...
| run_solaris_zts: ${{ (matrix.branch.version[0] == 8 && matrix.branch.version[1] >= 3) || matrix.branch.version[0] >= 9 }} | |
| run_solaris_zts: ${{ (matrix.branch.version[0] == 8 && matrix.branch.version[1] >= 6) || matrix.branch.version[0] >= 9 }} |
|
|
||
| #if defined(_POSIX_TZNAME_MAX) | ||
| # define MAX_ABBR_LEN _POSIX_TZNAME_MAX | ||
| /* Solaris exposes _POSIX_TZNAME_MAX = 3 unless _XPG6 is defined. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess it might be better to update timelib in its own PR.
| --EXPECTREGEX-- | ||
| Warning: posix_ttyname\(\): Argument #1 \(\$file_descriptor\) must be between 0 and \d+ in .+ on line \d+ | ||
| bool\(false\) | ||
| string\(\d+\) "Bad file (descriptor|number)" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why don't you just use EXPECTF with %r(descriptor|number)%r ? That's what you could use in other tests as well
| li" | ||
|
|
||
| Notice: fwrite(): Write of 37 bytes failed with errno=9 Bad file descriptor in %s on line %d | ||
| Notice: fwrite(): Write of 37 bytes failed with errno=9 Bad file %s in %s on line %d |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you try with?
| Notice: fwrite(): Write of 37 bytes failed with errno=9 Bad file %s in %s on line %d | |
| Notice: fwrite(): Write of 37 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d |
No description provided.